package com.achun.getcouponleague.utils;

import com.google.gson.Gson;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrogitManager {

    private final Retrofit retrofit;

    private RetrogitManager(){
        //创建Retrofit
        retrofit = new Retrofit.Builder().baseUrl(Constant.BASEURL)
                .addConverterFactory(GsonConverterFactory.create()).build();

    }
    private static RetrogitManager retrogitManager=null;
    public static RetrogitManager getInstance(){
        if (retrogitManager == null) {
            synchronized (RetrogitManager.class){
                if (retrogitManager == null) {
                    retrogitManager=new RetrogitManager();
                }
            }
        }
       return retrogitManager;
    }

    public Retrofit getRetrofit(){
        return retrofit;
    }
}
